<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="sealte.hvpms.pojo.Admin" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>仓鼠网上投票系统HVPMS</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/mainPage.css"></link>
<script type="text/javascript" src="js/mainPage.js"></script>
<script type="text/javascript">
function logout(){
	if(confirm("确定退出？")==true){
		$.post('Logout',null,function callback(data){
			if(data=='"ok"'){
				window.location.href="<%=basePath%>hvpms_admin";
			}else{
				alert("退出失败，请联系开发者");
			}
		});
	}
}
</script>
</head>
<body>
<%
	Admin admin = (Admin)session.getAttribute("admin");
	if(admin!=null){
		String admin_level = admin.getLevel();
%>
<div id="frame_whole">
		<div id="frame_head">
			<table id="table_top">
				<tr>
					<td width="80%" align="left" valign="bottom"><img src="images/banner_inner.png"></td>
					<td width="10%" align="right" valign="bottom">管理员：<%=admin.getName() %></td>
					<td width="5%" align="right" valign="bottom">
						[<a href="javascript:logout()">退出</a>]
					</td>
					<td width="5%" align="right" valign="bottom">
						[<a href="util/hvpms_help.html" target="show_frame">帮助</a>]
					</td>
				</tr>
			</table>
		</div>
		<div id="frame_body">
			<div id="left">
				<table id="table_menu">
					<tr>
						<th><img src="images/page.png">&nbsp;限制规则管理</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="hvpms_admin/rules_management.jsp" target="show_frame">维护</a></td>
					</tr>
					<tr>
						<th><img src="images/messages_view.png">&nbsp;系统消息管理</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="hvpms_admin/messages_management.jsp" target="show_frame">维护</a></td>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="hvpms_admin/messages_add.jsp" target="show_frame">新增</a></td>
					</tr>
					<tr>
						<th><img src="images/user_home.png">&nbsp;注册用户管理</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="hvpms_admin/users_management.jsp" target="show_frame">维护</a></td>
					</tr>
					<%
						if(admin_level.equals("a")){
					%>
					<tr>
						<th><img src="images/group_gear.png">&nbsp;管理员管理</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="hvpms_admin/admin_management.jsp" target="show_frame">维护</a></td>
					</tr>
					<%
						}
					%>
					<tr>
						<th><img src="images/vcard.png">&nbsp;个人信息</th>
					</tr>
					<tr onmouseover=sbar(this) onmouseout=cbar(this)>
						<td><a href="hvpms_admin/modifyPassword.jsp" target="show_frame">修改密码</a></td>
					</tr>
				</table>
			</div>
			<div id="middle">
				<input type="button" name="close" id="middlebutton" onclick="middleButton()">
			</div>
			<div id="right">
				<iframe name="show_frame" src="welcome.html"></iframe>
			</div>
		</div>
	</div>
<%	
	}else{
		out.println("谢绝跨路径访问！");
	}
%>
</body>
</html>